﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Database.Models
{
    [Table("ThamDuyetPCCC")]
    public class ThamDuyetPCCC : BaseModel
    {
        public int Id { get; set; }

        [Required]
        [MaxLength(255)]
        public string SoVanBan { get; set; }

        [Required]
        public DateTime NgayCap { get; set; }

        [MaxLength(1000)]
        public string GhiChu { get; set; }

        public virtual VanBanThamDuyetPCCC VanBanThamDuyet { get; set; }
        public virtual CoQuanCapVanBanThamDuyet CoQuanCapVanBanThamDuyet { get; set; }
        public virtual PhieuDieuTraCoSo PhieuDieuTraCoSo { get; set; }

        [NotMapped]
        public string TenVanBan
        {
            get { return VanBanThamDuyet.Ten; }
        }

        [NotMapped]
        public string CoQuanCap
        {
            get { return CoQuanCapVanBanThamDuyet.Ten; }
        }
    }
}